﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Digitalmes.Configuration
{
    /// <summary>
    /// MQTT服务器设置
    /// </summary>
    public class MqttSettings
    {
        public int MaxConnectedClients { get; set; } = 1000;
        public int MaxPendingMessagesPerClient { get; set; } = 250;
        public string Username { get; set; }
        public string Password { get; set; }

        public TcpEndpointSettings TcpEndpoint { get; set; } = new TcpEndpointSettings();
        public WebSocketEndpointSettings WebSocketEndpoint { get; set; } = new WebSocketEndpointSettings();
    }

    /// <summary>
    /// TCP端点设置
    /// </summary>
    public class TcpEndpointSettings
    {
        public bool Enabled { get; set; } = true;
        public int Port { get; set; } = 1883;
        public bool EnableTls { get; set; } = false;
        public string CertificatePath { get; set; }
        public string CertificatePassword { get; set; }
    }

    /// <summary>
    /// WebSocket端点设置
    /// </summary>
    public class WebSocketEndpointSettings
    {
      
        public string Path { get; set; } = "/mqtt";
        public bool EnableTls { get; set; } = false;
        public string CertificatePath { get; set; }
        public string CertificatePassword { get; set; }
    }

}
